2 const assert
= require( 'assert' ),
3 EditPage
= require( '../pageobjects/edit.page' ),
4 HistoryPage
= require( '../pageobjects/history.page' ),
5 UserLoginPage
= require( '../pageobjects/userlogin.page' );
7 describe( 'Page', function () {
13 // disable VisualEditor welcome dialog
15 browser
.localStorage( 'POST', { key
: 've-beta-welcome-dialog', value
: '1' } );
18 beforeEach( function () {
19 browser
.deleteCookie();
20 content
= Math
.random().toString();
21 name
= Math
.random().toString();
24 it( 'should be creatable', function () {
27 EditPage
.edit( name
, content
);
30 assert
.equal( EditPage
.heading
.getText(), name
);
31 assert
.equal( EditPage
.displayedContent
.getText(), content
);
35 it( 'should be editable', function () {
37 var content2
= Math
.random().toString();
40 browser
.call( function () {
41 return EditPage
.apiEdit( name
, content
);
45 EditPage
.edit( name
, content2
);
48 assert
.equal( EditPage
.heading
.getText(), name
);
49 assert
.equal( EditPage
.displayedContent
.getText(), content2
);
53 it( 'should have history', function () {
56 browser
.call( function () {
57 return EditPage
.apiEdit( name
, content
);
61 HistoryPage
.open( name
);
62 assert
.equal( HistoryPage
.comment
.getText(), `(Created page with "${content}")` );